<template>
    <div class="address-detail clearfix">
      <div class="header">
        <div class="head-portrait">
          <img src="../../assets/avatar.png"/>
        </div>
        <div class="name">
          <p> <span v-text="employee.name"></span> <i class="fa fa-user-secret" style="color: #659FD2;"></i></p>
          <p v-text="employee.title"></p>
        </div>
      </div>
      <div class="content">
        <a class="mint-cell">
          <div class="mint-cell-wrapper">
            <div class="mint-cell-title">
              <span class="fa-stack fa-sm">
                <i class="fa fa-circle fa-stack-2x" style="color: #55CF9C"></i>
                <i class="fa fa-bank fa-stack-1x fa-inverse"></i>
              </span>
              <span class="mint-cell-title-text">单位</span>
            </div>
            <div class="mint-cell-value">
              <span v-text="employee.org"></span>
            </div>
          </div>
        </a>
        <a class="mint-cell">
          <div class="mint-cell-wrapper">
            <div class="mint-cell-title">
              <span class="fa-stack fa-sm">
                <i class="fa fa-circle fa-stack-2x" style="color: #507FB3"></i>
                <i class="fa fa-address-card-o fa-stack-1x fa-inverse"></i>
              </span>
              <span class="mint-cell-title-text">部门</span>
            </div>
            <div class="mint-cell-value">
              <span class="mint-cell-title__text" v-text="employee.department"></span>
            </div>
          </div>
        </a>
        <div class="space"></div>
        <a class="mint-cell">
        <div class="mint-cell-wrapper">
          <div class="mint-cell-title">
              <span class="fa-stack fa-sm">
                <i class="fa fa-circle fa-stack-2x" style="color: #FB871F"></i>
                <i class="fa fa-mobile fa-stack-1x fa-inverse"></i>
              </span>
            <span class="mint-cell-title-text">手机</span>
          </div>
          <div class="mint-cell-value is-link">
            <a :href="'tel:' + employee.tel">
              <span  v-text="employee.tel"></span>
            </a>
          </div>
          <i class="mint-cell-allow-right"></i>
        </div>
      </a>
        <a class="mint-cell">
          <span class="mint-cell-mask"></span>
          <div class="mint-cell-wrapper">
            <div class="mint-cell-title">
              <span class="fa-stack fa-sm">
                <i class="fa fa-circle fa-stack-2x" style="color: #507FB3"></i>
                <i class="fa fa-envelope-o fa-stack-1x fa-inverse"></i>
              </span>
              <span class="mint-cell-title-text">邮箱</span>
            </div>
            <div class="mint-cell-value is-link">
              <span v-text="employee.email">527350778@qq.com</span>
            </div>
            <i class="mint-cell-allow-right"></i>
          </div>
        </a>
      </div>
    </div>
</template>
<script>
  import { mapGetters } from 'vuex'
  export default {
    data () {
      return {
        employee:Object
      }
    },
    computed: {
      ...mapGetters([
        'employees'
      ])
    },
    mounted() {

      this.initEmployee()
    },
    methods: {
      initEmployee (){
        let index = this.$route.params.index
        this.employee = this.employees[index]

      }
    },
    deactivated () {
      this.$destroy()
    }
  }
</script>
<style scoped lang="scss">
  @import '../../base/css/_base';
  .address-detail {
    height: 100%;
    .header {
      @include flex-left;
      padding: 20px;
      background: #F0EFF5;
      .head-portrait{
        width: 50px;
        height: 50px;
        img {
          width: 100%;
          height: auto;
          border-radius: 4px;
          border: 1px solid #eee;
        }
      }
      .name{
        flex: 1;
        margin: 0 10px;
        p:first-child{
          @include fz(6px)
        }
        p:last-child{
          color: #7b7b7b;
          @include fz(5px);
          line-height: 25px;
        }
      }
    }
    .content{
    }
    .mint-cell-title-text {
      @include fz(6px);
      color: #7b7b7b;
    }
    .mint-cell-value{
      @include fz(6px);
    }
    .mint-cell-allow-right{
      @include fz(2px);
    }
    .space {
      background: #F0EFF5;
      height: 30px;
    }
    .is-link {
      color: #267EA3!important;
    }
  }
  .slide-enter-active{
    transition:all 0.4s;
  }
  .slide-enter, .slide-leave-active{
    transform:translate3d(100%, 0, 0);
    transition:all 0.4s;
  }
</style>
